//
// Created by xili on 2024/9/19 19:56.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int longestContinuousSubstring(string s) {
        int ans = 1, cnt = 1;
        for (int i = 1; i < s.length(); i++) {
            if (s[i - 1] + 1 == s[i]) {
                ans = max(ans, ++cnt);
            } else {
                cnt = 1;
            }
        }
        return ans;
    }
};
